package com.xiaocheng.auto;

import com.xiaocheng.bean.HelloProperties;
import com.xiaocheng.serivce.HelloSerivce;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(HelloProperties.class)
public class HelloSerivceAutoComfiguration {
    @ConditionalOnMissingBean(HelloSerivce.class)
    @Bean
    public HelloSerivce helloSerivce(){
        HelloSerivce helloSerivce = new HelloSerivce();
        return helloSerivce;
    }
}
